import request from '@/utils/request'


export function uploadUncheckFile(id, formData) {
  return request({
    url: '/uncheck/uncheck/filePath/' + id,
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  });
}
export function uploadUncheckAppval(id, formData) {
  return request({
    url: '/uncheck/uncheck/appvalPath/' + id,
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  });
}

// 附件上传
export function uploadUncheckAttachment(id, formData) {
  return request({
    url: '/uncheck/uncheck/attachment/' + id,
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  });
}

// 文章内容图片上传
export function uploadContentImage(file) {
  const formData = new FormData();
  formData.append('file', file);
  return request({
    url: '/uncheck/uncheck/contentImage',
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  });
}

// 查询uncheck列表
export function listUncheck(query) {
  return request({
    url: '/uncheck/uncheck/list',
    method: 'get',
    params: query
  })
}


export function listUncheckSeek(query) {
  return request({
    url: '/uncheck/uncheck/list2',
    method: 'get',
    params: query
  })
}


// 查询uncheck详细
export function getUncheck(articleId) {
  return request({
    url: '/uncheck/uncheck/' + articleId,
    method: 'get'
  })
}

// 新增uncheck
export function addUncheck(data) {
  return request({
    url: '/uncheck/uncheck',
    method: 'post',
    data: data
  })
}



//审核文章加入article
export function auditArticle(data){
  return request({
    url: '/uncheck/uncheck/audit',
    method: 'post',
    data: data,
  })
}

//更新已审核的文章
export function updateToArticle(data) {
  return request({
    url: '/uncheck/uncheck/updateToArticle',
    method: 'put',
    data: data
  })
}

//删除已审核的文章
export function delArticleByAuditId(auditId) {
  return request({
    url: '/uncheck/uncheck/deleteAuditId/'+auditId,
    method: 'delete'
  })
}

//逻辑删除
export function logicDeleteUncheck(articleIds) {
  return request({
    url: '/uncheck/uncheck/logicDelete/' + articleIds,
    method: 'post'
  })
}

// 修改uncheck
export function updateUncheck(data) {
  return request({
    url: '/uncheck/uncheck',
    method: 'put',
    data: data
  })
}

// 删除uncheck
export function delUncheck(articleId) {
  return request({
    url: '/uncheck/uncheck/' + articleId,
    method: 'delete'
  })
}
